package com.example.abstractprocessordemo;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.libannotation.BindActivity;
import com.example.libannotation.BindView;
import com.example.libannotation.contentView;
import com.example.libannotation.viewClick;

@BindActivity
public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    @contentView(contentId = R.layout.activity_main)
    View view;
    @BindView(viewId = R.id.text)
    TextView textView;
    @BindView(viewId = R.id.text1)
    TextView textView1;
    @BindView(viewId = R.id.btn)
    @viewClick
    Button btn;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        BindMainActivity.bind(this);
        textView.setText("change the text success!");
        textView1.setText("你好呀");
        btn.setOnClickListener(this);
        Log.d("是数据","hhhh");
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if(id == R.id.btn){
            startActivity(new Intent(MainActivity.this,MainActivity2.class));

        }
    }
}